package com.legolas.provider1.api.testapi;


import com.alibaba.dubbo.config.annotation.Service;
import com.legolas.api.service.TestService;
import com.legolas.provider1.api.serviceapi.activemq.QueueProducer;
import org.springframework.beans.factory.annotation.Autowired;

import javax.jms.JMSException;

@Service(version = "1.0.0", interfaceClass = com.legolas.api.service.TestService.class, group = "group1")
public class TestService1API implements TestService {

    @Autowired
    QueueProducer queueProducer;

    @Override
    public String test(String msg) {
        return "provider1——group1提供的服务:" + msg;
    }

    @Override
    public void queueProducer(String msg) {
        try {
            queueProducer.produce("我是来自provider1的" + msg);
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
